#ifndef CHESSBOARDVIEW_H
#define CHESSBOARDVIEW_H

#include "View.h"
#include "Field.h"
#include "Headers.h"
#include "Position.h"
#include "ApplicationSettings.h"
#include "PossibleMoves.h"

class ChessBoardView : public QWidget, public View
{
    Q_OBJECT
private:
    QVector<Field*> objects;
    PossibleMoves possibleMoves;
    int mouseX;
    int mouseY;

    void markMouseOverField(QPainter & painter);
    void markPossibleMoves(QPainter & painter);
public:
    explicit ChessBoardView(QWidget *parent = 0);
    ~ChessBoardView();

    void draw(Field * object);
    void clearDrawable();
    void setPossibleMoves(const PossibleMoves & moves);
signals:
    void mouseMoved(int x, int y);
public slots:

protected:
    void init();
    void paintEvent(QPaintEvent *);
    void mouseMoveEvent(QMouseEvent * e);
};

#endif // CHESSBOARDVIEW_H
